﻿
namespace sgs_Entity
{
    #region 牌枚举
    /// <summary>
    /// 牌花色（空NA、黑桃Spade、红桃Heart、梅花Club、方块Diamond）
    /// </summary>
    public enum CardSuit
    {
        /// <summary>
        /// 空
        /// </summary>
        NA,

        /// <summary>
        /// 黑桃
        /// </summary>
        Spade,

        /// <summary>
        /// 红桃
        /// </summary>
        Heart,

        /// <summary>
        /// 梅花
        /// </summary>
        Club,

        /// <summary>
        /// 方块
        /// </summary>
        Diamond
    }

    /// <summary>
    /// 牌种类（空NA、基本Base、锦囊Skill、装备Equipment）
    /// </summary>
    public enum CardSort
    {
        /// <summary>
        /// 空
        /// </summary>
        NA,

        /// <summary>
        /// 基本
        /// </summary>
        Base,

        /// <summary>
        /// 锦囊
        /// </summary>
        Skill,

        /// <summary>
        /// 装备
        /// </summary>
        Equipment
    }

    /// <summary>
    /// 装备牌类型（空NA武器Weapon、防具Armor、马Steed）
    /// </summary>
    public enum EquipmentCardType
    {
        /// <summary>
        /// 空
        /// </summary>
        NA,

        /// <summary>
        /// 武器
        /// </summary>
        Weapon,

        /// <summary>
        /// 防具
        /// </summary>
        Armor,

        /// <summary>
        /// 马
        /// </summary>
        Steed
    }

    /// <summary>
    /// 技能牌类型（空NA、非延时类锦囊Realtime、延时类锦囊Delayed）
    /// </summary>
    public enum SkillCardType
    {
        /// <summary>
        /// 空
        /// </summary>
        NA,

        /// <summary>
        /// 非延时
        /// </summary>
        Realtime,

        /// <summary>
        /// 延时
        /// </summary>
        Delayed
    }

    /// <summary>
    /// 牌类型（空NA、普杀Kill、闪Evade、桃Peach、雷杀ThunderKill、酒Liquor、火杀FireKill、无懈可击Invulnerable、过河拆桥DemolishingBridge、铁索连环IronChainLink、顺手牵羊WalkingOff、无中生有Fabrication、决斗Duel、南蛮入侵SouthernManInvasion、火攻FireAttack、乐不思蜀EnjoymentDrown、借刀杀人MuderWithBorrowedKnife、五谷丰登BumperHarvest、兵粮寸断SupplyShortage、闪电Lightning、桃园结义OathInPeachGarden、万箭齐发MyriadsOfArrows、绝影Shadow、的盧DiLu、爪黄飞电YellowHoof、赤兔RedRabbit、紫骍PurpleXing、大宛DaWan、骅骝HuaLiu、八卦阵FormationOfEightDiagrams、藤甲RattanArmor、仁王盾ShieldOfBenevolentKing、白银狮子SilverLionHelmet、诸葛连弩ArbalestOfZhuge、雌雄双股剑CoupleSword、青釭剑SteelSword、寒冰剑FreezingSword、古锭刀AncientIngotSaber、贯石斧RockPenetratingAxe、青龙偃月刀AzureDragonCrescentSword、丈八蛇矛ZhangbaSerpentSpear、方天画戟FangtianPatternedHalberd、朱雀羽扇RosefinchPlumeFan、麒麟弓KylinBow）
    /// </summary>
    public enum CardType
    {
        /// <summary>
        /// 空
        /// </summary>
        NA,

        /// <summary>
        /// 杀
        /// </summary>
        杀,

        /// <summary>
        /// 闪
        /// </summary>
        闪,

        /// <summary>
        /// 桃
        /// </summary>
        桃,

        /// <summary>
        /// 雷杀
        /// </summary>
        雷杀,

        /// <summary>
        /// 酒
        /// </summary>
        酒,

        /// <summary>
        /// 火杀
        /// </summary>
        火杀,

        /// <summary>
        /// 无懈可击
        /// </summary>
        无懈可击,

        /// <summary>
        /// 过河拆桥
        /// </summary>
        过河拆桥,

        /// <summary>
        /// 铁索连环
        /// </summary>
        铁索连环,

        /// <summary>
        /// 顺手牵羊
        /// </summary>
        顺手牵羊,

        /// <summary>
        /// 无中生有
        /// </summary>
        无中生有,

        /// <summary>
        /// 决斗
        /// </summary>
        决斗,

        /// <summary>
        /// 南蛮入侵
        /// </summary>
        南蛮入侵,

        /// <summary>
        /// 火攻
        /// </summary>
        火攻,

        /// <summary>
        /// 乐不思蜀
        /// </summary>
        乐不思蜀,

        /// <summary>
        /// 借刀杀人
        /// </summary>
        借刀杀人,

        /// <summary>
        /// 五谷丰登
        /// </summary>
        五谷丰登,

        /// <summary>
        /// 兵粮寸断
        /// </summary>
        兵粮寸断,

        /// <summary>
        /// 闪电
        /// </summary>
        闪电,

        /// <summary>
        /// 桃园结义
        /// </summary>
        桃园结义,

        /// <summary>
        /// 万箭齐发
        /// </summary>
        万箭齐发,

        /// <summary>
        /// 绝影
        /// </summary>
        绝影,

        /// <summary>
        /// 的盧
        /// </summary>
        的盧,

        /// <summary>
        /// 爪黄飞电
        /// </summary>
        爪黄飞电,

        /// <summary>
        /// 赤兔
        /// </summary>
        赤兔,

        /// <summary>
        /// 紫骍
        /// </summary>
        紫骍,

        /// <summary>
        /// 大宛
        /// </summary>
        大宛,

        /// <summary>
        /// 骅骝
        /// </summary>
        骅骝,

        /// <summary>
        /// 八卦阵
        /// </summary>
        八卦阵,

        /// <summary>
        /// 藤甲
        /// </summary>
        藤甲,

        /// <summary>
        /// 仁王盾
        /// </summary>
        仁王盾,

        /// <summary>
        /// 白银狮子
        /// </summary>
        白银狮子,

        /// <summary>
        /// 诸葛连弩
        /// </summary>
        诸葛连弩,

        /// <summary>
        /// 雌雄双股剑
        /// </summary>
        雌雄双股剑,

        /// <summary>
        /// 青釭剑
        /// </summary>
        青釭剑,

        /// <summary>
        /// 寒冰剑
        /// </summary>
        寒冰剑,

        /// <summary>
        /// 古锭刀
        /// </summary>
        古锭刀,

        /// <summary>
        /// 贯石斧
        /// </summary>
        贯石斧,

        /// <summary>
        /// 青龙偃月刀
        /// </summary>
        青龙偃月刀,

        /// <summary>
        /// 丈八蛇矛
        /// </summary>
        丈八蛇矛,

        /// <summary>
        /// 方天画戟
        /// </summary>
        方天画戟,

        /// <summary>
        /// 朱雀羽扇
        /// </summary>
        朱雀羽扇,

        /// <summary>
        /// 麒麟弓
        /// </summary>
        麒麟弓
    }

    /// <summary>
    /// 卡包（空NA、标准Standard、Ex Extension、军争Military）
    /// </summary>
    public enum CardSet
    {
        /// <summary>
        /// 空
        /// </summary>
        NA,

        /// <summary>
        /// 标准
        /// </summary>
        Standard,

        /// <summary>
        /// Ex
        /// </summary>
        Extension,

        /// <summary>
        /// 军争
        /// </summary>
        Military
    }

    /// <summary>
    /// 卡状态（空NA、未使用Free、在玩家手上InHand、被装备Equiped、被屯留（屯田）Collected、被使用（乐不思蜀，兵粮寸断、闪电）Used、被弃Discarded）
    /// </summary>
    public enum CardStatus
    {
        /// <summary>
        /// 空
        /// </summary>
        NA,

        /// <summary>
        /// 未使用
        /// </summary>
        Free,

        /// <summary>
        /// 在玩家手上
        /// </summary>
        InHand,

        /// <summary>
        /// 被装备
        /// </summary>
        Equiped,

        /// <summary>
        /// 被屯留（屯田）
        /// </summary>
        Collected,

        /// <summary>
        /// 被使用（乐不思蜀，兵粮寸断、闪电）
        /// </summary>
        Used,

        /// <summary>
        /// 被弃
        /// </summary>
        Discarded
    }
    #endregion

    /// <summary>
    /// 牌基类
    /// </summary>
    public class Card
    {
        #region 字段
        private int _iD = default(int);                 // 主键
        private string _name = string.Empty;            // 牌名
        private int _cardNum = default(int);            // 点数
        private CardSuit _cardSuit = CardSuit.NA;       // 花色
        private CardSort _cardSort = CardSort.NA;       // 种类
        private CardType _cardType = CardType.NA;       // 类型
        private CardSet _cardSet = CardSet.NA;          // 卡包
        private CardStatus _cardStatus = CardStatus.NA; // 状态
        private Player _belongToPlayer = null;          // 属于某玩家
        #endregion

        #region 属性
        /// <summary>
        /// Gets or sets 主键
        /// </summary>
        public int ID
        {
            get { return _iD; }
            set { _iD = value; }
        }
        /// <summary>
        /// Gets or sets 牌名
        /// </summary>
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }
        /// <summary>
        /// Gets or sets 点数
        /// </summary>
        public int CardNum
        {
            get { return _cardNum; }
            set { _cardNum = value; }
        }
        /// <summary>
        /// Gets or sets 花色
        /// </summary>
        public CardSuit CardSuit
        {
            get { return _cardSuit; }
            set { _cardSuit = value; }
        }
        /// <summary>
        /// Gets or sets 种类
        /// </summary>
        public CardSort CardSort
        {
            get { return _cardSort; }
            set { _cardSort = value; }
        }
        /// <summary>
        /// Gets or sets 类型
        /// </summary>
        public CardType CardType
        {
            get { return _cardType; }
            set { _cardType = value; }
        }
        /// <summary>
        /// Gets or sets 卡包
        /// </summary>
        public CardSet CardSet
        {
            get { return _cardSet; }
            set { _cardSet = value; }
        }
        /// <summary>
        /// Gets or sets 状态
        /// </summary>
        public CardStatus CardStatus
        {
            get { return _cardStatus; }
            set { _cardStatus = value; }
        }
        /// <summary>
        /// Gets or sets 所属玩家
        /// </summary>
        public Player BelongToPlayer
        {
            get { return _belongToPlayer; }
            set { _belongToPlayer = value; }
        }
        #endregion

        #region 方法
        /// <summary>
        /// 初始化卡牌
        /// </summary>
        /// <param name="ID">主键</param>
        /// <param name="Name">牌名</param>
        /// <param name="CardNum">点数</param>
        /// <param name="CardSuit">花色</param>
        /// <param name="CardSort">种类</param>
        /// <param name="CardType">类型</param>
        /// <param name="CardSet">卡包</param>
        public Card(int ID, string Name, int CardNum, CardSuit CardSuit, CardSort CardSort, CardType CardType, CardSet CardSet)
        {
            this._iD = ID;
            this._name = Name;
            this._cardNum = CardNum;
            this._cardSuit = CardSuit;
            this._cardSort = CardSort;
            this._cardType = CardType;
            this._cardSet = CardSet;
        }
        #endregion
    }
    /// <summary>
    /// 基本牌
    /// </summary>
    public class BasicCard : Card
    {
        #region 字段
        #endregion

        #region 属性

        #endregion

        #region 方法
        /// <summary>
        /// 初始化基本牌
        /// </summary>
        /// <param name="ID">主键</param>
        /// <param name="Name">牌名</param>
        /// <param name="CardNum">点数</param>
        /// <param name="CardSuit">花色</param>
        /// <param name="CardType">类型</param>
        /// <param name="CardSet">卡包</param>
        public BasicCard(int ID, string Name, int CardNum, CardSuit CardSuit, CardType CardType, CardSet CardSet)
            : base(ID, Name, CardNum, CardSuit, CardSort.Base, CardType, CardSet)
        {
        }
        #endregion
    }
    /// <summary>
    /// 锦囊牌
    /// </summary>
    public class SkillCard : Card
    {
        #region 字段
        private SkillCardType _skillType = SkillCardType.NA;    // 技能牌类型
        #endregion

        #region 属性
        /// <summary>
        /// 技能牌类型
        /// </summary>
        public SkillCardType SkillType
        {
            get { return _skillType; }
            set { _skillType = value; }
        }
        #endregion

        #region 方法
        /// <summary>
        /// 初始化锦囊牌
        /// </summary>
        /// <param name="ID">主键</param>
        /// <param name="Name">牌名</param>
        /// <param name="CardNum">点数</param>
        /// <param name="CardSuit">花色</param>
        /// <param name="CardType">类型</param>
        /// <param name="CardSet">卡包</param>
        public SkillCard(int ID, string Name, int CardNum, CardSuit CardSuit, CardType CardType, CardSet CardSet, SkillCardType SkillType)
            : base(ID, Name, CardNum, CardSuit, CardSort.Skill, CardType, CardSet)
        {
            this._skillType = SkillType;
        }
        #endregion
    }
    /// <summary>
    /// 装备牌
    /// </summary>
    public class EquipmentCard : Card
    {
        #region 字段
        private EquipmentCardType _equipmentType = EquipmentCardType.NA;    // 装备牌类型
        #endregion

        #region 属性
        /// <summary>
        /// 装备牌类型
        /// </summary>
        public EquipmentCardType EquipmentType
        {
            get { return _equipmentType; }
            set { _equipmentType = value; }
        }
        #endregion

        #region 方法
        /// <summary>
        /// 初始化装备牌
        /// </summary>
        /// <param name="ID">主键</param>
        /// <param name="Name">牌名</param>
        /// <param name="CardNum">点数</param>
        /// <param name="CardSuit">花色</param>
        /// <param name="CardType">类型</param>
        /// <param name="CardSet">卡包</param>
        /// <param name="EquipmentCardType">装备牌类型</param>
        public EquipmentCard(int ID, string Name, int CardNum, CardSuit CardSuit, CardType CardType, CardSet CardSet, EquipmentCardType EquipmentCardType)
            : base(ID, Name, CardNum, CardSuit, CardSort.Equipment, CardType, CardSet)
        {
            this._equipmentType = EquipmentCardType;
        }
        #endregion
    }
    /// <summary>
    /// 武器牌
    /// </summary>
    public class WeaponEquipmentCard : EquipmentCard
    {
        #region 字段
        private int _range = default(int);  // 攻击范围
        #endregion

        #region 属性
        /// <summary>
        /// 攻击范围    
        /// </summary>
        public int Range
        {
            get { return _range; }
            set { _range = value; }
        }
        #endregion

        #region 方法
        /// <summary>
        /// 初始化武器牌
        /// </summary>
        /// <param name="ID">主键</param>
        /// <param name="Name">牌名</param>
        /// <param name="CardNum">点数</param>
        /// <param name="CardSuit">花色</param>
        /// <param name="CardType">类型</param>
        /// <param name="CardSet">卡包</param>
        /// <param name="Range">攻击范围</param>
        public WeaponEquipmentCard(int ID, string Name, int CardNum, CardSuit CardSuit, CardType CardType, CardSet CardSet, int Range)
            : base(ID, Name, CardNum, CardSuit, CardType, CardSet, EquipmentCardType.Weapon)
        {
            this._range = Range;
        }
        #endregion
    }
    /// <summary>
    /// 防具牌
    /// </summary>
    public class ArmorEquipmentCard : EquipmentCard
    {
        #region 字段
        #endregion

        #region 属性
        #endregion

        #region 方法
        /// <summary>
        /// 初始化防具牌
        /// </summary>
        /// <param name="ID">主键</param>
        /// <param name="Name">牌名</param>
        /// <param name="CardNum">点数</param>
        /// <param name="CardSuit">花色</param>
        /// <param name="CardType">类型</param>
        /// <param name="CardSet">卡包</param>
        public ArmorEquipmentCard(int ID, string Name, int CardNum, CardSuit CardSuit, CardType CardType, CardSet CardSet)
            : base(ID, Name, CardNum, CardSuit, CardType, CardSet, EquipmentCardType.Armor)
        {
        }
        #endregion
    }
    /// <summary>
    /// 马牌
    /// </summary>
    public class SteedEquipmentCard : EquipmentCard
    {
        #region 字段
        private int _distance = default(int);   // 距离
        #endregion

        #region 属性
        /// <summary>
        /// 距离
        /// </summary>
        public int Distance
        {
            get { return _distance; }
            set { _distance = value; }
        }
        #endregion

        #region 方法
        /// <summary>
        /// 初始化马牌
        /// </summary>
        /// <param name="ID">主键</param>
        /// <param name="Name">牌名</param>
        /// <param name="CardNum">点数</param>
        /// <param name="CardSuit">花色</param>
        /// <param name="CardType">类型</param>
        /// <param name="CardSet">卡包</param>
        /// <param name="Distance">距离</param>
        public SteedEquipmentCard(int ID, string Name, int CardNum, CardSuit CardSuit, CardType CardType, CardSet CardSet, int Distance)
            : base(ID, Name, CardNum, CardSuit, CardType, CardSet, EquipmentCardType.Steed)
        {
            this._distance = Distance;
        }
        #endregion
    }
}
